<template>
  <div class="layout-header w-100 h-100 d-flex ai-center jc-between">
    <div class="layout-header-left d-flex ai-center jc-between gap-2">
      <div class="logo"></div>
      <h3 class="text-withe h">川信校友之家</h3>
    </div>
    <div class="layout-header-left pe-2">
      <el-dropdown>
        <span class="el-dropdown-link">
          <div class="d-flex ai-center jc-between grp-2">
            <el-avatar :src="userStore.userInfo.avatar || ''" />
            <span style="color: white;">{{ userStore.userInfo.username || '未登录' }}</span>
          </div>
          <el-icon class="el-icon--right">
            <arrow-down />
          </el-icon>
        </span>
        <template #dropdown>
          <el-dropdown-menu>
            <el-dropdown-item>修改密码</el-dropdown-item>
            <el-dropdown-item>个人中心</el-dropdown-item>
            <el-dropdown-item @click="userStore.logout()">退出登录</el-dropdown-item>
            <!-- <el-dropdown-item disabled>Action 4</el-dropdown-item>
            <el-dropdown-item divided>Action 5</el-dropdown-item> -->
          </el-dropdown-menu>
        </template>
      </el-dropdown>
    </div>
  </div>
</template>

<script lang="ts" setup>
import { useUserStore } from '@/stores/user'
const userStore = useUserStore();

</script>

<style lang="scss" scoped>
.logo {
  width: 40px;
  height: 40px;
  // background: url("//public/img/logo.png") no-repeat center center / cover;
  background: url(/img/logo.png) center center / cover no-repeat;
}
</style>
